#include<bits/stdc++.h>
using namespace std;
string s;
char c1,  c2;
int  main(){
	cin>>s>>c1>>c2;
	for(auto&i:s)
	if(i==c1)
	i=c2;
	cout<<s;
}